package demo2;

public class Test {
    public static void main(String[] args) {

    }
    private static int partition(int[] array,int left,int right) {
        int index = left;
        while (left < right) {
            while (left < right && array[left] <= array[index]) {
                left++;
            }
            while (left < right && array[right] >= array[index]) {
                right--;
            }
            int temp = array[left];
            array[left] = array[right];
            array[right] = temp;
        }
        int temp = array[left];
        array[left] = array[index];
        array[index] = temp;
        return left;
    }

}
